from django.shortcuts import render
from .models import Tab

def tab_view(request):
    tabs = Tab.objects.filter(is_active=True).order_by('order')
    tabs_data = []
    
    for tab in tabs:
        tabs_data.append({
            'id': f'tab{tab.id}',
            'title': tab.title,
            'content': tab.content
        })
    
    return render(request, 'mytabs/tabs.html', {'tabs': tabs_data})
